<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Shopping Cart | FreshMart</title>
  <link rel="stylesheet" href="style.css">
  <style>
    .cart-container {
      max-width: 800px;
      margin: 2rem auto;
      padding: 1rem;
    }
    .cart-header {
      display: grid;
      grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
      gap: 1rem;
      padding: 1rem;
      background-color: #f5f5f5;
      font-weight: bold;
    }
    .cart-item {
      display: grid;
      grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
      gap: 1rem;
      padding: 1rem;
      border-bottom: 1px solid #eee;
      align-items: center;
    }
    .cart-total {
      margin-top: 2rem;
      text-align: right;
      font-size: 1.2rem;
      font-weight: bold;
    }
    .checkout-btn {
      display: block;
      width: 200px;
      margin: 2rem auto;
      padding: 1rem;
      background-color: #4CAF50;
      color: white;
      border: none;
      border-radius: 4px;
      cursor: pointer;
      font-size: 1.1rem;
    }
    .checkout-btn:hover {
      background-color: #45a049;
    }
    .empty-cart {
      text-align: center;
      padding: 2rem;
      color: #666;
    }
  </style>
</head>
<body>
  <!-- ── Header ── -->
  <header>
    <div class="logo">
      <img src="images/logo.jpg" alt="FreshMart logo">
    </div>
    <nav>
      <ul>
        <li><a href="index.html">Home</a></li>
        <li><a href="products.html">Products</a></li>
        <li><a href="about.html">About Us</a></li>
        <li><a href="contact.html">Contact</a></li>
        <li><a href="cart.html" class="active">Cart</a></li>
      </ul>
    </nav>
  </header>

  <main class="cart-container">
    <h1>Shopping Cart</h1>
    <div class="cart-header">
      <span>Product</span>
      <span>Price</span>
      <span>Quantity</span>
      <span>Total</span>
      <span>Action</span>
    </div>
    <div id="cart-items">
      <!-- Cart items will be dynamically added here -->
    </div>
    <div class="cart-total">
      Total: <span id="total-price">€0.00</span>
    </div>
    <button class="checkout-btn" onclick="checkout()">Checkout</button>
  </main>

  <footer>
    <p>&copy; 2025 FreshMart | <a href="about.html">About Us</a></p>
  </footer>

  <script src="js/script.js"></script>
  <script>
    window.loadCart();
    window.updateCartDisplay();
  </script>
</body>
</html> 